<f:layout name="Default" />

<f:section name="main">
    <div class="hide"><f:flashMessages renderMode="div" /></div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="row">
                <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                    <f:if condition="{settings.enableImport}">
                        <f:then>
                            <f:form action="list" name="pay" class="form-inline" method="post" enctype="multipart/form-data">
                                <input type="file" name="tx_payment_pay[excelImport]" data-classbutton="btn btn-default" data-classinput="form-control inline" data-buttonText="选择" class="filestyle form-control" />
                                <f:form.submit value="导入" class="btn btn-sm btn-default"/>
                                <a href="{f:uri.resource(path:'example.xls')}" class="btn btn-sm btn-info" target="_blank">下载示例</a>
                            </f:form>
                        </f:then>
                        <f:else>
                            <f:link.action action="list" arguments="{excelExport: 1, keyword:keyword}" class="btn btn-sm btn-default">导出</f:link.action>
                        </f:else>
                    </f:if>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 text-right">
                    <f:form action="list" name="pay" class="form-inline" method="get">
                        <div class="input-group">
                            <f:form.textfield name="keyword" value="{keyword}" class="input-sm form-control" placeholder="关键字"/>
                            <span class="input-group-btn">
                                <f:form.submit value="搜索" class="btn btn-sm btn-default"/>
                            </span>
                        </div>
                    </f:form>
                </div>
            </div>
        </div>
        <f:widget.paginate objects="{pays}" as="paysItems" configuration="{settings.paginate}">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>编号</th>
                            <th><f:translate key="tx_payment_domain_model_pay.name" /></th>
                            <th><f:translate key="tx_payment_domain_model_pay.money" /></th>
                            <th><f:translate key="tx_payment_domain_model_pay.crdate" /></th>
                            <th><f:translate key="tx_payment_domain_model_pay.payment" /></th>
                            <th class="text-right">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <f:for each="{paysItems}" as="pay">
                        <tr>
                            <td>{pay.uid}</td>
                            <td>{pay.name}</td>
                            <td><f:format.currency currencySign="￥" decimalSeparator="." thousandsSeparator=",">{pay.money}</f:format.currency></td>
                            <td>{pay.crdate -> f:format.date(format:'Y-m-d')}</td>
                            <td>{pay.payment}</td>
                            <td class="text-right">
                                <f:link.action action="show" arguments="{pay : pay}" class="btn btn-primary btn-xs">详细</f:link.action>
                                <f:if condition="{pay.certnumber}">
                                    <a href="uploads/certificate/{pay.certnumber}.jpg" class="btn btn-info btn-xs" target="_blank">证书</a>
                                </f:if>
                                <f:link.action action="delete" arguments="{pay : pay}" class="btn btn-danger btn-xs" onclick="return confirm('确定删除?');">删除</f:link.action>
                            </td>
                        </tr>
                    </f:for>
                    </tbody>
                </table>
            </div>
        </f:widget.paginate>
    </div>
</f:section>